def recursiveSum(arr):
    if (len(arr) == 0):
        return 0
    if (len(arr) == 1):
        return arr[0]
    return arr.pop(0) + recursiveSum(arr) 

def loopSum(arr):
    result = 0;
    for i in range(0, len(arr)):
        result += arr[i]
    return result

target = [1,3,4,45,5,6,7,7,8,131,4,3,34,215,42,54,256,43,65,36,53,76,47,65,87]
target2 = [5,1]

print(loopSum(target[0:len(target)]))
print(recursiveSum(target))


print(recursiveSum(target2[0:len(target2)]))
print(loopSum(target2))



